import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
  {
    path: "/index",
    name: "layout",
    component: () => import("@/layout/index.vue"),
    redirect: "/index/fileUpload",
    children: [
      {
        path: "fileUpload",
        name: "fileUpload",
        meta: {
          title: "文件上传",
          icon: "upload2",
        },
        component: () => import("@/views/fileUpload/index.vue"),
      },
      {
        path: "fileManagement",
        name: "fileManagement",
        meta: {
          title: "文件管理",
          icon: "folder-opened",
        },
        component: () => import("@/views/fileManagement/index.vue"),
      },
      {
        path: "downloadHistory",
        name: "downloadHistory",
        meta: {
          title: "下载记录",
          icon: "tickets",
        },
        component: () => import("@/views/downloadHistory/index.vue"),
      },
      {
        path: "weChat",
        name: "weChat",
        meta: {
          title: "聊天窗口",
          icon: "chat-line-round",
        },
        component: () => import("@/views/weChat/index.vue"),
      },
      // {
      //   path: "userManagement",
      //   name: "userManagement",
      //   meta: {
      //     title: "用户管理",
      //     icon: "user",
      //   },
      //   component: () => import("@/views/userManagement/index.vue"),
      // },
    ],
  },
  {
    path: "/",
    name: "login",
    component: () => import("@/views/login.vue"),
  },
];
export const asyncRouter = [
  {
    path: "userManagement",
    name: "userManagement",
    meta: {
      title: "用户管理",
      icon: "user",
    },
    component: () => import("@/views/userManagement/index.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
